using System;

namespace Beetle.Controller;

public class ControllerServer<T> : ServerBase<T> where T : Package
{
	private h a = new h();

	protected override void OnOpening()
	{
		a.b(this);
		base.OnOpening();
	}

	public void RegisterController(Type type)
	{
		a.b(type);
	}

	public void RegisterController(object controller)
	{
		a.b(controller);
	}

	protected override void OnMessageReceive(PacketRecieveMessagerArgs e)
	{
		base.OnMessageReceive(e);
		if (!a.Invoke(e.Channel, e.Message))
		{
			NotControllerInvokeMessage(e);
		}
	}

	protected virtual void NotControllerInvokeMessage(PacketRecieveMessagerArgs e)
	{
	}
}
